<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>移除数组中给定值的相同元素</title>
	</head>
	<body>
		<p id="demo"></p>
		<script>
			var arr=[2,3,1,2,1,8,9,2];
			var target=2;
			function show(array,design){
				for(var i=0;i<array.length;i++){
//					console.log('i',array[i]);
					if(array[i]==design){
						array.splice(i,1);
						console.log('arr',array);                      
					}	
					
				}
			}
			show(arr,target);
		</script>
	</body>
</html>
